JavaCloak — Considering the Limitations of Proxies for Facilitating Java Reflection
نویسندگان
چکیده
This paper discusses issues pertaining to mechanisms which can be used to change the behaviour of Java classes at runtime. The proxy mechanism will be compared to and contrasted with other standard approaches to this problem. Some of the problems the proxy mechanism is subject to will be expanded upon. The question of whether statically-developed proxies can ever be a viable alternative to bytecode rewriting was investigated by means of the JavaCloak system, which uses staticallygenerated proxies to alter the run-time behaviour of externally-developed code. The issues addressed in this paper include ensuring type safety, dealing with the self problem, object encapsulation, and issues of object identity and equality. Some performance figures are provided which demonstrate the load the proxy mechanism places on the system. The paper concludes that the proxy mechanism, as utilised for runtime reflection, cannot be viable.
منابع مشابه
Experience with statically-generated proxies for facilitating Java runtime specialisation
This paper discusses issues pertaining to mechanisms which can be used to change the behaviour of Java classes at runtime. The proxy mechanism will be compared to and contrasted with other standard approaches to this problem. Some of the problems the proxy mechanism is subject to will be expanded upon. The question of whether statically-developed proxies are a viable alternative to bytecode rew...
متن کاملJavacloak : Engineering Java Tm Proxy Objects Using Reeection
Java programmers need to be able to locally specialise the run-time behaviour of externally developed code in order to increase software reuse. We describe JavaCloak, a system that supports local specialisation by using proxy objects. The proxy object and the object it wraps (the wrapped object) are typed with the same full-quali ed Java class name and a specialised classloader is used by the p...
متن کاملSafe uniform proxies for Java
The proxy abstraction has a long-lasting tradition in object-oriented programming. From design patterns to inherent programming language support, from remote method invocations to simple forms of behavioral reflection – incarnations as well as applications of proxies are innumerable. Since version 1.3, Java supports the concept of dynamic proxy. Such an object conforms to a set of types specifi...
متن کامل1 Java ’ s Reflection Model and Design Patterns
Dynamic proxies support meta-programming and extend the reflective abilities of Java beyond pure introspection. Proxy objects are interpreted as meta-objects that control the behaviour of application objects at the base level. In this paper, we investigate the implications of applying reflective programming techniques provided by proxies. We address the problem of how such proxies can support o...
متن کاملImproving the Transparency of Proxy Injection in Java
Due to their flexibility, proxies have been used for various purposes in standalone and distributed applications. More specifically, object-level proxies support fine grained capabilities and offer the potential to transparently (i.e. with minimal human intervention) inject proxy-based functionality into an ordinary application. Consequently, several solutions based upon code transformation for...
متن کامل